package com.cxkj.shop.proc.order;

import net.wangds.common.processor.AbstractInputOutputProcessor;

import org.apache.ibatis.session.SqlSessionFactory;

import com.cxkj.shop.model.order.Order;
import com.cxkj.shop.proc.DefaultSelectOneMybatisProc;

public class QueryOrderByIdProc extends
		AbstractInputOutputProcessor<String, Order> {

	private DefaultSelectOneMybatisProc<String, Order> proc = new DefaultSelectOneMybatisProc<String, Order>();
	private String orderId;

	public String getOrderId() {
		return orderId;
	}

	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	public String getSqlId() {
		return proc.getSqlId();
	}

	public void setSqlId(String sqlId) {
		proc.setSqlId(sqlId);
	}

	public SqlSessionFactory getSessionFac() {
		return proc.getSessionFac();
	}

	public void setSessionFac(SqlSessionFactory sessionFac) {
		proc.setSessionFac(sessionFac);
	}

	@Override
	protected Order process(String orderId) throws Exception {
		Order order = null;
		proc.setParameter(this.getOrderId());
		proc.process();
		order = proc.getResult();
		return order;
	}

}
